<template>
	<view>
		<!-- 物流信息 -->
		<view class="list-box">
			<view class="align-center list-item">
				<view class="ft14 bold">{{ems_company_name}}{{$t('shop').快递}}:{{delivery_no}}</view>
				<view class="list-copy" @click="copyBtn(delivery_no)">{{$t('index').复制}}</view>
			</view>
		</view>
		<view class="bgWhite">
			<view class="plr15 ptb15">
				<view class="" v-for="(item,index) in logInfo" :key="index">
					<!-- 					<view class="flex-col align-center">
						<image src="../../static/images/mine/shixinyuan.png" mode="aspectFill"
							style="width: 44rpx;height: 44rpx;"></image>

						<view class="colLine " style="margin-top: 4rpx;" v-if="index<logInfo.length-1"></view>
					</view> -->
					<view class="align-center">
						<image src="../../static/images/mine/shixinyuan.png" mode="aspectFill"
							style="width: 44rpx;height: 44rpx;"></image>
						<view class="ml10"><text>{{item.ftime}}</text></view>
					</view>
					<view class="pl10 ptb8">
						<view class="pl10" style="border-left: 2rpx solid #EEEEEE;">
							<view class=""><text>{{item.context}}</text></view>
						</view>
					</view>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				logInfo: [],
				order_id: '',
				ems_company_name: '',
				delivery_no: ''
			}
		},
		onLoad(options) {
			this.$store.dispatch('getuserInfo')
			this.order_id = options.order_id
			this.ems_company_name = options.ems_company_name
			this.delivery_no = options.delivery_no
			this.orderexpressAPI()
		},
		methods: {
			async orderexpressAPI() {
				const res = await this.$api.orderexpress({
					order_id: this.order_id
				})
				this.logInfo = res.data
			},
			// 复制
			copyBtn(value) {
				uni.setClipboardData({
					//准备复制的数据
					data: value,
					success: function(res) {
						uni.showToast({
							title: this.$t('shop').复制成功,
						});
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.list-box {
		padding: 34rpx 24rpx 15rpx;

		.list-item {
			margin-bottom: 24rpx;

			.list-copy {
				width: 80rpx;
				height: 36rpx;
				color: #2A2A2A;
				font-size: 22rpx;
				text-align: center;
				line-height: 36rpx;
				border-radius: 100rpx;
				border: 2rpx solid #2A2A2A;
				margin-left: 24rpx;
			}

			.list-left {
				width: 136rpx;
			}
		}

	}

	.colLine {
		width: 0;
		height: 148rpx;
		opacity: 1;
		border: 2rpx solid #EEEEEE;
	}
</style>